package com.easy.cms.material.repository;

import com.easy.cms.material.model.EnterpriseMaterialBinding;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface EnterpriseMaterialBindingRepository extends JpaRepository<EnterpriseMaterialBinding, Long> {
    @Query("SELECT e FROM EnterpriseMaterialBinding e WHERE e.material.name LIKE %:materialName% AND e.customCode LIKE %:customCode%")
    Page<EnterpriseMaterialBinding> findByMaterialNameAndCustomCode(String materialName, String customCode, Pageable pageable);
}